package com.IntelligentCommunity.community.api.factory;

import com.IntelligentCommunity.common.core.domain.R;
import com.IntelligentCommunity.community.api.RemoteDistrictService;
import com.IntelligentCommunity.community.domain.RealDistrict;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author 美国五星上将麦克阿瑟
 */
@Component
public class RemoteDistrictFallbackFactory implements FallbackFactory<RemoteDistrictService> {
    @Override
    public RemoteDistrictService create(Throwable cause) {
        return new RemoteDistrictService() {
            @Override
            public R<RealDistrict> findById(Long id) {
                return R.fail();
            }
        };
    }
}
